package com.bauer.base.synchronize;

/**
 * @Author ：rui.wei
 * @Date ：Created in 15:17 2019/6/3
 * @Description：
 */
public class SyncObject {

    public synchronized int add(int a ,int b){
        System.out.println("add before");
        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("add after");
        return a+b;
    }

    public synchronized int addx(int a ,int b){
        System.out.println("addx");
        return a+b;
    }
}
